import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ChargeStrategy } from 'src/entities/ChargeStrategy';
import { Device } from 'src/entities/Device';
import { MqttModule } from 'src/mqtt/mqtt.module';
import { ChargeCardOrderRealTimeInfo, ChargeCardOrderRealTimeInfoSchema } from 'src/schemas/ChargeCardOrder.schema';
import { ChargeOrderRealTimeInfo, ChargeOrderRealTimeInfoSchema } from 'src/schemas/ChargeOrder.schema';
import { DeviceRecord, DeviceSchema } from 'src/schemas/Device.schema';
import { DeviceService } from './device.service';

@Module({
  imports : [
    MqttModule, TypeOrmModule.forFeature([Device, ChargeStrategy]),
    MongooseModule.forFeature([
      { name: DeviceRecord.name, collection : DeviceRecord.name, schema: DeviceSchema },
      { name: ChargeOrderRealTimeInfo.name, collection : ChargeOrderRealTimeInfo.name, schema: ChargeOrderRealTimeInfoSchema},
      { name: ChargeCardOrderRealTimeInfo.name, collection : ChargeCardOrderRealTimeInfo.name, schema: ChargeCardOrderRealTimeInfoSchema}
    ])
  ],
  providers: [DeviceService]
})
export class DeviceModule {}
